<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>std.complex</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "std.complex";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/std.complex.html" class="symbol">std.complex</a></h1>
  
<div class="summary">Module that will replace the built-in types <span class="d_psymbol"><i>cfloat</i></span>, <span class="d_psymbol"><i>cdouble</i></span>,
<span class="d_psymbol"><i>creal</i></span>, <span class="d_psymbol"><i>ifloat</i></span>, <span class="d_psymbol"><i>idouble</i></span>, and <span class="d_psymbol"><i>ireal</i></span>.</div>
<p class="sec_header">Author:</p><a href="http://erdani.org">Andrei Alexandrescu</a>
<div id=quickindex></div>
<dl>
<dt class="decl">enum <a class="symbol _enum" name="Representation" href="./htmlsrc/std.complex.html#L26" kind="enum" beg="26" end="32">Representation</a>; <a title="Permalink to this symbol" href="#Representation" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L26">#</a></dt>
<dd class="ddef">
<div class="summary">Representation choices for the <span class="d_psymbol"><i>Complex</i></span> type. Cartesian
representation is better when using additive operations and when real
and imaginary part are to be manipulated separately. Polar
representation is more advantageous when using multiplicative
operations and when modulus and angle are to be manipulated
separately.</div>
<dl>
<dt class="decl"><a class="symbol _enummem" name="Representation.cartesian" href="./htmlsrc/std.complex.html#L29" kind="enummem" beg="29" end="29">cartesian</a> <a title="Permalink to this symbol" href="#Representation.cartesian" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L29">#</a></dt>
<dd class="ddef">
<div class="summary">Use Cartesian representation.</div></dd>
<dt class="decl"><a class="symbol _enummem" name="Representation.polar" href="./htmlsrc/std.complex.html#L31" kind="enummem" beg="31" end="31">polar</a> <a title="Permalink to this symbol" href="#Representation.polar" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L31">#</a></dt>
<dd class="ddef">
<div class="summary">Use polar representation.</div></dd></dl></dd>
<dt class="decl">struct <a class="symbol _struct" name="Complex" href="./htmlsrc/std.complex.html#L39" kind="struct" beg="39" end="83">Complex</a><span class="tparams">(Num, Representation rep = Representation.cartesian)</span>; <a title="Permalink to this symbol" href="#Complex" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L39">#</a></dt>
<dd class="ddef">
<div class="summary">Complex type parameterized with the numeric type (e.g. <span class="d_psymbol"><i>float</i></span>, <span class="d_psymbol"><i>
double</i></span>, or <span class="d_psymbol"><i>real</i></span>) and the representation.</div>
<dl>
<dt class="decl">Num <a class="symbol _variable" name="Complex.re" href="./htmlsrc/std.complex.html#L46" kind="variable" beg="46" end="46">re</a>; <a title="Permalink to this symbol" href="#Complex.re" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L46">#</a></dt>
<dt class="decl">Num <a class="symbol _variable" name="Complex.im" href="./htmlsrc/std.complex.html#L46" kind="variable" beg="46" end="46">im</a>; <a title="Permalink to this symbol" href="#Complex.im" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L46">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">Num <a class="symbol _function" name="Complex.getRe_" href="./htmlsrc/std.complex.html#L47" kind="function" beg="47" end="47">getRe_</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Complex.getRe_" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L47">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">Num <a class="symbol _function" name="Complex.getIm_" href="./htmlsrc/std.complex.html#L48" kind="function" beg="48" end="48">getIm_</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Complex.getIm_" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L48">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">Num <a class="symbol _function" name="Complex.getModulus_" href="./htmlsrc/std.complex.html#L49" kind="function" beg="49" end="49">getModulus_</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Complex.getModulus_" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L49">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">Num <a class="symbol _function" name="Complex.getAngle_" href="./htmlsrc/std.complex.html#L50" kind="function" beg="50" end="50">getAngle_</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Complex.getAngle_" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L50">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">alias getRe_ <a class="symbol _alias" name="Complex.getRe" href="./htmlsrc/std.complex.html#L64" kind="alias" beg="64" end="64">getRe</a>; <a title="Permalink to this symbol" href="#Complex.getRe" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L64">#</a></dt>
<dd class="ddef">
<div class="summary">Gets the real component of the number. Might involve a
calculation, subject to representation. Use <span class="d_psymbol"><i>x.re</i></span> to statically
enforce Cartesian representation.</div></dd>
<dt class="decl">alias getIm_ <a class="symbol _alias" name="Complex.getIm" href="./htmlsrc/std.complex.html#L70" kind="alias" beg="70" end="70">getIm</a>; <a title="Permalink to this symbol" href="#Complex.getIm" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L70">#</a></dt>
<dd class="ddef">
<div class="summary">Gets the imaginary component of the number. Might involve a
calculation, subject to representation. Use <span class="d_psymbol"><i>x.im</i></span> to statically
enforce Cartesian representation.</div></dd>
<dt class="decl">alias getModulus_ <a class="symbol _alias" name="Complex.getModulus" href="./htmlsrc/std.complex.html#L76" kind="alias" beg="76" end="76">getModulus</a>; <a title="Permalink to this symbol" href="#Complex.getModulus" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L76">#</a></dt>
<dd class="ddef">
<div class="summary">Gets the modulus of the number. Might involve a calculation, subject
to representation. Use <span class="d_psymbol"><i>x.modulus</i></span> to statically enforce polar
representation.</div></dd>
<dt class="decl">alias getAngle_ <a class="symbol _alias" name="Complex.getAngle" href="./htmlsrc/std.complex.html#L82" kind="alias" beg="82" end="82">getAngle</a>; <a title="Permalink to this symbol" href="#Complex.getAngle" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L82">#</a></dt>
<dd class="ddef">
<div class="summary">Gets the angle of the number. Might involve a calculation, subject to
representation. Use <span class="d_psymbol"><i>x.angle</i></span> to statically enforce polar
representation.</div></dd></dl></dd>
<dt class="decl"><a class="symbol _unittest" name="unittest" href="./htmlsrc/std.complex.html#L85" kind="unittest" beg="85" end="91">unittest</a>; <a title="Permalink to this symbol" href="#unittest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.complex.html#L85">#</a></dt>
<dd class="ddef"></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 1999-2008 by Digital Mars ®, All Rights Reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Sun Dec 28 04:26:37 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>